package com.dhcc.wb.articleday;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;

import com.dhcc.bussiness.page.PageBean;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ArticledayAction extends ActionSupport {
	private static final long serialVersionUID = 1L;
	private static Logger logger = Logger.getLogger(ActionSupport.class);
	
	
	
	private Integer currentPage;
	private Integer currentCount = 10;
	private PageBean<ArticleModel> pageBean = new PageBean<ArticleModel>();
	private ArticleDayService service = new ArticleDayService();
	
	
	
	
	public String articleday() throws Exception {
		// TODO Auto-generated method stub
		
		HttpServletRequest request = ServletActionContext.getRequest();
		int currentPage = Integer.parseInt(request.getParameter("currentPage")==null?"1":request.getParameter("currentPage"));//规定是第一页
		String title = request.getParameter("title");
		String gzhname = request.getParameter("gzhname");
		pageBean = service.findArticleServiceByPage(currentPage,currentCount,title,gzhname);
		ActionContext.getContext().getSession().put("pageBean", pageBean);
		return SUCCESS;
	}




	public Integer getCurrentPage() {
		return currentPage;
	}




	public void setCurrentPage(Integer currentPage) {
		this.currentPage = currentPage;
	}




	public Integer getCurrentCount() {
		return currentCount;
	}




	public void setCurrentCount(Integer currentCount) {
		this.currentCount = currentCount;
	}




	public PageBean<ArticleModel> getPageBean() {
		return pageBean;
	}




	public void setPageBean(PageBean<ArticleModel> pageBean) {
		this.pageBean = pageBean;
	}




	public ArticleDayService getService() {
		return service;
	}




	public void setService(ArticleDayService service) {
		this.service = service;
	}
	




	
}
